Skip to content

chore(dashboards): Improve number formatting documentation#112410

Open
gggritso wants to merge 7 commits intomasterfrom
experiment-better-number-formatting-docs
Open

chore(dashboards): Improve number formatting documentation#112410
gggritso wants to merge 7 commits intomasterfrom
experiment-better-number-formatting-docs

Conversation

@gggritso
Copy link
Copy Markdown
Member

@gggritso gggritso commented Apr 7, 2026

I took a pass at the numbers-and-types documentation I wrote a while back. I replaced the page with a new one, that's more focused and gives more practical explanations of how we approach this. I hope this'll be more useful, since the Dashboards team has been getting more feedback in this area.

There are many TODOs in this document. I'd love for us to come together and close them off by making decisions. However, we don't need to do that right now! I'd be perfectly happy to merge this, and start implementing the guidelines and iterate on them gradually.

Most of this is just documenting existing guidelines. There are some notable additions, like scientific notation.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 7, 2026
- **Rounding**. We often round numbers before rendering them. This saves on UI space, creates better scannability, and more correctly represents reality (not all fractional digits are significant). **Sentry rounds numbers to 3 significant digits in most cases** but uses more (4-5) in contexts where it might be useful.
- **Trailing Zeroes**. Generally, **Sentry renders numbers with a floating decimal point**. e.g., we render `"1.2"` rather than `"1.20"`. This often creates visual misalignment in tables and Y-axes, and is worth reconsidering.
- **Multipliers**. Some data types benefit from multipliers, whether by prefix or by unit. e.g., for `integer` values, a multiplier can save a lot of space (`"12,341,000"` vs. `"12.3M"`). The same goes for types with known units like durations (`"431312 bytes"` vs. `"0.411 MiB"`). **Sentry formats numbers using the nearest appropriate multiplier** whenever possible. If the value exceeds the maximum or minumum multiplier (e.g., a duration of >1000 years, or a size of <0.001 bytes) **Sentry uses scientific notation**.
- **Units**. If data has a known unit, **Sentry _always_ shows the unit alongside the value**. Sentry shows the full unit (e.g., `"milliseconds"`) in expanded contexts like detail panels, and the abbreviated unit in other contexts.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Praise] Yes this in particular is really good to know! I'd never thought of this deeply before. +1

@ivy-sentry ivy-sentry marked this pull request as ready for review April 15, 2026 00:15
@ivy-sentry ivy-sentry requested a review from a team as a code owner April 15, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants